#pragma once

#include <iostream>
#include <filesystem>
#include <string>
#include <render/Others/PerseusLibDefines.h>
#include <render/Model/Model.h>
#include <render/Model/ModelH.h>


namespace pwp {

class Renderer3DObject {
public:
  int objectId;

  Model* model;
  ModelH* drawingModel;

  VFLOAT pmMatrix[16];

  Renderer3DObject(const char* data_ptr, int data_size, int objectId, float scale = 1.0f) {
    this->objectId = objectId;

    //model = new Model(data_ptr, data_size, FMT_OBJ, scale);
    model = new Model(data_ptr, data_size, FMT_PLY, scale);

    drawingModel = new ModelH();
    model->ToModelHInit(drawingModel);
  }

  Renderer3DObject(std::string fileName, int objectId, float scale = 1.0f) {
    this->objectId = objectId;

    model = new Model(fileName, scale);
    drawingModel = new ModelH();
    model->ToModelHInit(drawingModel);
  }
#if 0
  void GetModelViewMatrix(float* modelViewMatrix) {
    objectCoordinateTransform->GetModelViewMatrix(modelViewMatrix);
  }
#endif
  ~Renderer3DObject(void) {
    delete model;
    delete drawingModel;
  }
};

}
